namespace mplat {
    export enum PlatType {
        web = 0,
        wx,
        tt,
        qq,
        vivo,
        oppo,
        mz,
        xm,
        bd,
        ali
    }
    export interface IPlatform {
        ad: IAd;
        system: ISystem;
        openAbility: IOpenAbility;
        ui: IUiInterface;
        device: IDevice;

        platType: PlatType;
        openId: string;

        init();
    }

    export class BasePlatform implements IPlatform {
        ad: IAd;
        system: ISystem;
        openAbility: IOpenAbility;
        ui: IUiInterface;
        device: IDevice;

        protected _platType: PlatType;
        get platType(): PlatType {
            return this._platType;
        }
        protected _openId: string;

        get openId(): string {
            return this._openId;
        }
        set openId(id: string) {
            this._openId = id;
        }

        constructor() {
            this.init()
        }

        init() {
            this.ad = new Ad()
            this.system = new BaseSystem()
            this.openAbility = new OpenAbility()
            this.ui = new BaseUiInterface()
            this.device = new BaseDevice()

            this._platType = PlatType.web;
        }
    }
}